﻿#region Copyright Statement
//////////////////////////////////////////////
//                                          //
//      Created By:   Ali Ghomi             //
//      Date:         21 Jan 2010           //
//////////////////////////////////////////////
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ORMAC.Attributes
{
    /// <summary>
    /// Attribite class used to map enum member items to XML node values
    /// </summary>
    [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
    public class CodeAttribute:BaseAttribute
    {
        private bool m_IsNumber;
        /// <summary>
        /// if this code is a number
        /// </summary>
        public bool IsNumber
        {
            get
            {
                return m_IsNumber;
            }
            set
            {
                m_IsNumber = value;
            }
        }

        private string m_Code;
        /// <summary>
        /// xml code for the enum member
        /// </summary>
        public string Code
        {
            get
            {
                return m_Code;
            }
            set
            {
                m_Code = value;
            }
        }
        private bool m_IsExact;
        /// <summary>
        /// is this the exact code or partial code
        /// </summary>
        public bool IsExact
        {
            get
            {
                return m_IsExact;
            }
            set
            {
                m_IsExact = value;
            }
        }
        public CodeAttribute(string code)
            : this("", code)
        {
        }
        public CodeAttribute(string schema, string code)
        {
            m_Code = code;
            m_Schema = schema;
            m_IsNumber = false;
            m_IsExact = false;
        }
        public CodeAttribute(string schema, string code,bool isNumber)
        {
            m_Code = code;
            m_Schema = schema;
            m_IsNumber = isNumber;
            m_IsExact = false;
        }

    }
}
